package com.mall.book.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mall.book.entity.po.SaleStock;
import com.mall.book.mappers.SaleStockMapper;
import com.mall.book.service.SaleStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.Map;
import java.util.function.Function;

/**
 * Created by Dizziness on 2022/3/24 10:22
 */
@Service
public class SaleStockServiceImpl implements SaleStockService {
    @Autowired
    SaleStockMapper saleStockMapper;

    @Override
    public boolean saveBatch(Collection<SaleStock> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdateBatch(Collection<SaleStock> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean updateBatchById(Collection<SaleStock> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdate(SaleStock entity) {
        return false;
    }

    @Override
    public SaleStock getOne(Wrapper<SaleStock> queryWrapper, boolean throwEx) {
        return saleStockMapper.selectOne(queryWrapper);
    }

    @Override
    public Map<String, Object> getMap(Wrapper<SaleStock> queryWrapper) {
        return null;
    }

    @Override
    public <V> V getObj(Wrapper<SaleStock> queryWrapper, Function<? super Object, V> mapper) {
        return null;
    }

    @Override
    public BaseMapper<SaleStock> getBaseMapper() {
        return saleStockMapper;
    }

    @Override
    public Class<SaleStock> getEntityClass() {
        return SaleStock.class;
    }


    @Override
    public SaleStock getStock(String book_id) {
        return saleStockMapper.selectStock(book_id);
    }

    @Override
    public int updateEvenDeleted(SaleStock saleStock) {
        return saleStockMapper.updateEvenDeleted(saleStock);
    }

    @Override
    public boolean changeDeletedStatus(String id, int status) {
        return saleStockMapper.updateDeletedStatus(id, status);
    }

}
